import request from '../utils/request';

export const login = query => {
    console.log(query);
    return request({
        url: '/admin/login',
        method: 'post',
        params: query
    });
};
export const getUserList = query => {
    return request({
        url: "/admin/user/getUserList",
        method: "get",
        params: query
    })
};
export const getGoodsList = query => {
    return request({
        url: "/admin/goods/getGoodsList",
        method: "get",
        params: query
    })
}
export const getCategoryList = query => {
    return request({
        url: "/category/getCategoryList",
        method: "get",
        params: query
    })
}
export const getGoodsSku = query => {
    return request({
        url: "/admin/goods/getGoodsSku",
        method: "get",
        params: query
    })
}

export const editGoodsSku = query => {
    return request({
        url: "/admin/goods/editGoodsSku",
        method: "post",
        params: query
    })
}
export const addGoodsSku = query => {
    return request({
        url: "/admin/goods/addGoodsSku",
        method: "post",
        params: query
    })
}
export const removeGoodsSku = query => {
    return request({
        url: "/admin/goods/removeGoodsSku",
        method: "delete",
        params: query
    })
}
export const editGoods = query => {
    return request({
        url: "/admin/goods/editGoods",
        method: "post",
        params: query
    })
}
export const addGoods = query => {
    return request({
        url: "/admin/goods/addGoods",
        method: "post",
        params: query
    })
}
export const getOrderList = query => {
    return request({
        url: "/admin/order/getOrderList",
        method: "get",
        params: query
    })
}
export const getOrderDetailedList = query => {
    return request({
        url: "/admin/orderDetailed/getOrderDetailedList",
        method: "get",
        params: query
    })
}
export const getUser = query => {
    return request({
        url: "/admin/user/getUser",
        method: "get",
        params: query
    })
}
export const removeGoods = query => {
    return request({
        url: "/admin/goods/removeGoods",
        method: "delete",
        params: query
    })
}
export const d = query => {
    return request({
        url: "/pay/d",
        method: "get",
        params: query
    })
}
export const refound = query => {
    return request({
        url: '/pay/refund',
        method: "post",
        params: query
    })
}
export const editCategory = query => {
    return request({
        url: "/admin/category/editCategory",
        method: "post",
        params: query
    })
}
export const addCategory = query => {
    return request({
        url: "/admin/category/addCategory",
        method: "post",
        params: query
    })
}
export const removeCategory = query => {
    return request({
        url: "/admin/category/deleteCategory",
        method: "delete",
        params: query
    })
}
export default {
    login,
    getUserList,
    getGoodsList,
    getCategoryList,
    getGoodsSku,
    editGoodsSku,
    addGoodsSku,
    removeGoodsSku,
    editGoods,
    addGoods,
    getOrderList,
    getOrderDetailedList,
    getUser,
    removeGoods,
    d,
    refound,
    editCategory,
    addCategory,
    removeCategory
}